package com.example.chengma.controller;

import com.example.chengma.pojo.vo.JsonResultVO;
import com.example.chengma.service.ICommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/v1")
public class CommentController {
    @Autowired
    ICommentService commentService;
    @GetMapping("/{qid}")
    public List<JsonResultVO> getComment(@PathVariable int qid){
        List<JsonResultVO> jsonResultVO = commentService.selectJsonResultVO(qid);
        return jsonResultVO;
    }
}
